package adminlte.model;

import lombok.Data;

/**
 * @author ZHUFEIFEI
 */
@Data
public class Menu {
    protected Long id;
    protected Long pid;
    protected String text;
    protected String icon;
    protected String url;
    protected String targetType;
    protected String urlType;
    protected Boolean header;
    protected Boolean open;

    private static final String TARGET_TYPE_DEFAULT = "iframe-tab";
    private static final String URL_TYPE_DEFAULT = "relative";
    private static final String ICON_DEFAULT = "fa fa-circle-o";

    public Menu() {
        this.targetType = TARGET_TYPE_DEFAULT;
        //默认圆形图标
        this.icon = ICON_DEFAULT;
        this.urlType = URL_TYPE_DEFAULT;
    }

    public Menu(Long id, Long pid, String text, String url) {
        this();
        this.id = id;
        this.pid = pid;
        this.text = text;
        this.url = url;
    }

    public Menu(Long id, Long pid, String text, String url, boolean isHeader) {
        this();
        this.id = id;
        this.pid = pid;
        this.text = text;
        this.url = url;
        this.header = isHeader;
    }

    public Menu(Long id, Long pid, String text, String url, String icon, boolean isHeader) {
        this(id, pid, text, url, isHeader);
        this.icon = icon;
    }
}
